045 high speed counters
大家好,在这个视频中,我们将学习如何说计数器。
Hello, in this video, we will learn how to speak counters.
我将转到设备配置并离开,单击您的 CPU 并完成您需要的操作。
I will go to device configuration and left, click to your C.P.U and done what you need.
您需要在一般区域检查该区域。
You need to check this area in the general area.
您将看到高速计数器,其中您将看到六个不同的计数器,好的,例如,高速计数器一和二、三和四、五和六。
You will see high speed counters and in that you will see six different counter, OK, high speed counter one and two, three and four and five and six, for example.
如果你想在你的CPU上放一个编码器并且你想使用高速控制就OK了,那么你需要启用这个框,OK,启用这个高速控制,你可以给你的高速计数器起一个名字,你可以在这里输入一个命令,好的,就像这样。
If you want to put one encoder to your CPU and you want to use high speed control on OK, then you need to enable this box, OK, enable this high speed control and you can give a name to your high speed counter and you can put a command to here, OK, like this.
然后在功能区你会看到计数模型。
And then in the function area you will see the counting models.
好的,计数是来自编码器的脉冲,在该区域您将看到计数模式单快我们快a,b,反a,b计数器四倍。
OK, the count is a pulse coming comes from encoder and in this area you will see the counting mode single fast us fast a, b, contran a, b counter fourfold.
然后你也需要这样做。
And then also you need to.
我们可以看到周期、焦点和情绪控制,它们之间有什么区别?
We can see period and focus and emotion control, what is the differences between them?
好的,计数只是对脉冲的计数。
OK, count is just a count to pulses.
该周期用于计算来自编码器的脉冲的周期,并且您还将看到频率。
The period is for the calculate the period of the pulses coming coming from encoder and that also you will see the frequency.
我们可以计算编码器的频率,也可以得到像超现实轴一样的运动控制脉冲。
We can calculate the frequency of our encoder and also we can get a motion control pulses like a surreal axis.
想象一下,您有一个编码器连接到电机,并且您想从该箭头电机获取脉冲。
Imagine you have an encoder is connected to a motor and you want to get the pulses from this arrow motor.
然后就可以数了。
Then you can count.
您可以选择计数类型为运动控制,好吗?
You can select your counting type as motion control, OK?
您将看到进一步推进 B 控制和 B 控制四倍。
And that you will see just to further a B control and a B control fourfold.
好的,让我们进入计数类型计数,然后你会看到四种类型的模糊操作模糊单快太快a B Contran A B计数器四重a b我们要选择的国家y a b计数器意味着如果你的电机正在向前转动,则脉冲正在转动增加。
OK, let's go to count type counting and then you will see four type fuzzy operating fuzzy single fast too fast a B Contran A B counter fourfold a b countries that we are going to selected y a b counter means if your motor is turning forward, the pulses is going to increase.
如果您的电机逆时针旋转(另一个方向),您的脉冲量或反之,您的编码器脉冲量将会减少。
If your motor is turning the counterclockwise, another direction, your pulses volume or countervail your encoder pulse volume is going to decrease.
OK,一边是增加一边是减少脉冲。
OK, a side is increase besides decrease pulses.
假设您选择了 AB 计数器。
Imagine you selected AB counter.
好啦,数数数数。
OK, count up and count.
Tom Selleck 从初始计数方向开始,初始值也很重要。
Tom Selleck is here from the initial counting direction and also initial values is important.
例如,如果您的国家希望您的柜台数量从 500 开始,您需要投入 500,或者您可以从零开始。
For example, if your countries want if you want to start your counter volume from the 500, you need to put your five hundred or you can start from zero.
OK,这个参考值与即将计数值和高速控制器的参考值同步输入,然后使用外部同步输入倍频高位有效,低位上升沿和跟随沿等。
OK, and this reference value and the reference value to is about to counter value and high speed controller and synchronize input, then use external sync input octave high and also active, low and rising age and the following edge and etc..
这是您可以激活和捕获输入并获取输入和比较输出。
This is that you can activate and capture input and get input and compare output.
这些暂时对我们来说并不重要,甚至是中断的配置。
These are for a moment that's not important for us and even configuration that interrupts.
好的,如果你的计数器值达到了,比如500,这就是你的值,那么你可以用中断来启动一个程序循环或者一个程序区,你可以选择它,好吗?
OK, if your counter value is reached to, for example, 500, this is your value, then you can start a one program loop or one program area with the interrupt, you can select it, OK?
你可以给它起一个名字,并且更难打断。
And you can give a name of this around and harder interrupted.
你可以从这里选择,确定,或者你也可以创建它。
You can select from here, OK, or you can create it.
但我们不会使用中断和硬件输入。
But we are not going to use and interrupt and hardware input.
例如,编码器的 AI 输入将连接到输入零点零。
For example, your AI input of your encoder is going to connect it to input zero point zero.
好的,或者您可以从这里选择并输入 Klok 生成器。
OK, or you can select it from here and Klok generator be input.
它来自您的编码器,只要将其连接到输入零点一即可。
It comes from your encoder as far as ok it is going to connect it to input zero point one.
好的,您还可以更改同步输入和输入,并保持输入在这里,硬件输出用于比较输出。
OK, also you can change your sync input and input and keep your input is here and hardware output for the compare output.
我解决这个问题暂时并不重要。
It doesn't matter for a moment that I address this.
这对我们来说确实很重要。
This is really important for us for a moment.
1000 是我们的高速计数器 1 的起始地址。
One thousand is start address of our high speed counter one.
好的,让我们去缅因州或者是,让我们开始将我们的函数添加到这里。
OK, and let's go to Maine or be and let's start to add our function to here.
我将把我的功能块添加到这里。
I will add my function block to here.
我的意思是,这是一个函数功能块。
I mean, this is a function function block.
不是这样的。
Not not.
我是说。
I mean.
法庭就这样运作,好吗?
Functioning court like this, OK?
没关系。
It doesn't matter.
控制。
Control.
在这里。
In here.
我们需要控制它,看看,好吧,这就是控制。
We we need to control it as see, OK, this is the control.
高速计数器功能。
High speed counter function.
好的,我将这样添加到这里,然后它会自动创建一个数据块,这是数据块名称我会说,好的,所以我的高速计数器块被创建并插入到mean或B并完成我们将使用哪个计数器。
OK, I will add this to here like this, and then it is automatically creating a one data block and this is the data block name I will say, OK, so my high speed counter block is created and inserted to mean or B and done which counter that we are going to use.
我们将使用高速计数器一个好的方向,我们可以通过输入来改变方向,例如像这样输入零点七。
We will use high speed counter one OK direction that we can change the direction with the inputs for example like um input zero point seven like this for example.
嗯就像。
Um like.
这。
This.
我需要。
I need to.
把它放在这里。
Put it to here.
OK,我们可以激活输入零点七,或者dis激活,然后计数方向就会改变,但是暂时和严重没关系,你会看到我们严重是什么意思?
OK, we can activate input zero point seven and or dis activated and then the direction of the counting direction is going to change, but it doesn't matter for a moment and severe, you will see see we what is the meaning of severe?
严重的是我们可以将值加载到编码器中。
Severe is the we can load a value to our encoder.
例如,我们可以说这里的目标是零点零。
For example, we can say to here aim zero point zero.
好的,您会看到如果激活此 M 零点零,则可以确定手数的值在哪里。
OK, and you see where is the value of the lot that are OK if this M zero point zero is activated.
500 值将用于我们的高速控制。
Five hundred value is going to it to our high speed control.
好的,我们将从零开始,然后如果想象你在零点零处被激活,计数器值将是五百,我们将在五百一五百到五百三之后继续,就像这样。
OK, we will start from zero and then if imagine you are activated in zero point zero, the counter value will be five hundred and we will continue after five hundred one five hundred to five hundred three and like this.
好的。
OK.
我们也是。
Also are we.
这是参考值,我们也可以在这里说M零点一,OK。
This is the reference value also we can say to here M zero point one, OK.
我们可以在这里给出参考值,比如一百,好吧。
And we can give in here reference value like one hundred, OK.
我们可以加载它,但暂时不重要。
And we can load it but it doesn't matter for a moment.
新的周期我们也可以在这里给出一个时间段,好的,对于频率计算或频率计算,我们可以给一个新的周期一个时间值,我们可以用这个输入加载它,好的,对于状态了解我们的高速控制发生了什么。
And the new period also we can give a period of time to here, OK, for the frequency calculation or calculation of frequency, we can give a time value to a new period and we can load it with this input, OK, for the status to understand what's going on with our high speed control.
有没有错误?
Is there any error or not?
他们可以输入一个单词 theta,例如 m w 0。
They can put in one word theta like for example, m w zero.
好吧,为了美观,它有效吗?
OK, and for the beauty, is it working or not?
例如,M 两点零。
Like, for example, M two point zero.
OK,这就是高速计数器控制函数,这就是高速计数器的指令。
OK, this is the high speed counter control function and this is the instruction of the high speed counters.
这是第一个。
This is the first one.
好的,如果我们在这里再添加一个高速计数器块,并且想要使用第二个编码器和第二个高速计数器,我们该怎么办?
OK, if we add one more high speed counter block to here and if we want to use a second encoder and second high speed counter, what will we do?
我们在这里放两个,比如这样,好吗?
We will put here two, for example, like this, OK?
这是高速控制器。
And this is the high speed controller.
那么我们如何从这个高速计数器中获取值呢?
And then how can we get a value from this high speed counter?
这一刻确实很重要。
This is really important point for a moment.
我们会怎样做?
What will we do?
我们现在需要使用 mu 指令。
We need to use now mu instruction.
好的,这是。
OK, and this is.
更多的指导和数量即将到来。
More instruction and the volume is going to come.
一千,好吧,高速计数器的地址是多少,是一千。
One thousand, OK, what was the address of the high speed counter, it was one thousand.
让我们进入设备配置区域。
Let's go to device configuration area and.
让我们再次检查一下这里。
Let's check here once more.
一千,好吧,这是根据我们输入的地址的起始地址,我们去可能不是,现在我们可以了。
One thousand, OK, this is the start address according to our input addresses and let's go to may not be and now we can.
我们需要用来指责的电影部分在哪里?
Where is our movie section here that we need to use to blame?
Dateable,好吧,我的意思是,Doubler 的工作是从 1000 个地址获取值,好吧,例如,我们可以说 OK,那么这会发生什么呢?
Dateable, OK, I mean, Doubler work for the get get the value from the 1000 addresses, OK, and the for example, we can say for OK, so what will happen this?
功能控制 h a c 这个高速控制体积将根据我们的输入,呃,零点零和零点一,对来自编码器的脉冲进行计数。
Function control h a c this high speed control one volume is going to count the pulses from our encoder according to our input, uh, zero point zero and zero point one.
然后这个卷将被写入 1000 来寻址,我们将移动 1000 到 4 个 OK。
And then this volume is going to be written to 1000 to address and we will move 1000 to and the four OK.
然后我们可以从这四个读取编码器音量或脉冲音量。
And then we can read encoder volume or pulse volume from the four.
这是高速计数器块。
This is the high speed counter block.
还有我们如何从高速计数器中获取任意 M 个单词或 M 个 blipvert 的音量。
And also how can we get the volume from the high speed counter to any M words or M to blipverts.
好的,我们将在下一个视频中进行应用程序,从技术上讲它已经完成。
OK, and we will do an application the next videos for technically it's finished.
我今年的工作就完成了
I'm finished for this year.
下一个视频见。
See you in the next video.